/*
 * CommerceSessionFinalCommand.java
 *
 * Created on July 30, 2001, 10:58 AM
 */

/*
(C) Copyright MarketLive. 2006. All rights reserved.
MarketLive is a trademark of MarketLive, Inc.
Warning: This computer program is protected by copyright law and international treaties.
Unauthorized reproduction or distribution of this program, or any portion of it, may result
in severe civil and criminal penalties, and will be prosecuted to the maximum extent
possible under the law.
*/


package com.marketlive.biz.session.context;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.marketlive.biz.session.context.ICommerceSession;

// service imports

/**
 * @author elena
 */
public abstract class CommerceSessionCommand implements ISessionCommand {

    private static Log logger = LogFactory.getLog(CommerceSessionCommand.class);

    protected String name_ = "Unknown command";
    protected int status_;

    /**
     * Creates new CommerceSessionFinalCommand
     */
    public CommerceSessionCommand() {
        status_ = NOT_ISSUED;
    }

    public String getName() {
        return name_;
    }

    public void setName(String name) {
        name_ = name;
    }

    public int getStatus() {
        return status_;
    }

    /**
     * Executes the command and sets it's status based on the
     * execution outcome.
     *
     * @return int Returns SUCCESS or FATAL_ERROR.
     */
    public abstract int run(ICommerceSession session) throws Exception;
}
